package com.zdlee.netty.server15.client.handler;

import com.zdlee.netty.server10.response.MessageResponsePacket;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

import java.util.Date;

/**
 * @author zdlee
 * @description: ${DESCRIPTION}
 * @create 2018-11-29 16:31
 */
public class MessageResponseHandler extends SimpleChannelInboundHandler<MessageResponsePacket> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, MessageResponsePacket msg) throws Exception {
       // System.out.println(new Date() + ": 收到服务端的消息: " + msg.getMessage());
       String fromUserId=msg.getFromUserId();
       String fromUserName=msg.getFromUserName();
        System.out.println(fromUserId+":"+fromUserName+"->"+msg.getMessage());
    }
}
